package com.foreveross.crawl.common.util.value;

import java.util.List;

public final class NumberUtils {

	public static double getMinValue(List<Double> values){
		return org.apache.commons.lang3.math.NumberUtils.min(listToArray(values));
	}
	
	public static double getMaxValue(List<Double> values){
		return org.apache.commons.lang3.math.NumberUtils.max(listToArray(values));
	}
	
	public static double[] listToArray(List<Double> values){
		if(values == null) return null;
		double[] vs = new double[values.size()];
		for(int i = 0 ; i < values.size(); i++){
			vs[i] = values.get(i);
		}
		return vs;
	}
	
}
